<%@ page language="java" contentType="text/html; charset=UTF-8"
    import="java.util.List,com.web.common.po.FileInfo,com.web.filemanage.controller.FileController"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>文件列表</title>
	<jsp:include page="/plugins/bootstrap/include.jsp" />
</head>
<body>
<div class="container">
	<div class="list-group">
		<a href="#" class="list-group-item active">
			<h4 class="list-group-item-heading">
				文件列表
			</h4>
		</a>
		<%
		String path = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
		List<FileInfo> list = (List<FileInfo>)request.getSession().getAttribute(FileController.FILE_LIST);
		if(null != list){
		for (FileInfo info : list){ 
			String url = path+"/file/download?uid="+info.getFileUid(); %>
			<a href="<%=url %>" class="list-group-item">
				<h4 class="list-group-item-heading">
					<%=info.getFileName() %>
				</h4>
				<p class="list-group-item-text">
					点击下载
				</p>
			</a>
		<%} } %>
		
		<a href="<%=path %>/upload" class="list-group-item">
		<h4 class="list-group-item-heading">
			上传文件
		</h4>
		</a>
		
		<a href="<%=path %>/auth/loginOut" class="list-group-item">
		<h4 class="list-group-item-heading">
			注销登陆
		</h4>
		</a>
		
		<a href="<%=path %>/article/list" class="list-group-item active">
			<h4 class="list-group-item-heading">
				文章列表
			</h4>
		</a>
		
	</div>
</div>
<% request.getSession().removeAttribute(FileController.FILE_LIST); %>
</body>
</html>